<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.asaga.tools.*, java.util.*, java.io.*, java.net.*, java.util.*, java.sql.*"%>
<%--
     Author:  Jeremy Sanderlin 
     Date Created: 2006-12-02
     Last Modified: 2006-12-03
     Last Modified By: Jeremy Sanderlin
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>

<% 
    String message = (String)session.getAttribute("message"); 
    if(message==null){
        message="no message";
    }
    String fname = "";
    String lname = "";
    String addr1 = "";
    String addr2 = "";
    String city = "";
    String state = "";
    String zip = "";
    String email = "";
    String phone = "";
    String cell = "";
    String dob = "";
    String fontColor = "";
    
String username = (String)session.getAttribute("username");
SystemClient_DBImpl scdb = (SystemClient_DBImpl)session.getAttribute("userProfile");
SystemClient_DBImpl userProfile = scdb;
session.setAttribute("userProfile",scdb);


// classification-specific objects
int classId;
ResultSet classRs = (ResultSet)session.getAttribute("classRs");
ClassificationList classList = userProfile.getClassSet();


if(username==null){
    response.sendRedirect("login.jsp?message=Please log in again.");
}
    if(scdb!=null){
        if(scdb.getFname()!=null){fname = scdb.getFname();}
        if(scdb.getLname()!=null){lname = scdb.getLname();}
        if(scdb.getAddr1()!=null){addr1 = scdb.getAddr1();}
        if(scdb.getAddr2()!=null){addr2 = scdb.getAddr2();}
        if(scdb.getCity()!=null){city = scdb.getCity();}
        if(scdb.getState()!=null){state = scdb.getState();}
        if(scdb.getZip()!=null){zip = scdb.getZip();}
        if(scdb.getEmail()!=null){email = scdb.getEmail();}
        if(scdb.getPhone()!=null){phone = scdb.getPhone();}
        if(scdb.getCell()!=null){cell = scdb.getCell();}
        if(scdb.getDob()!=null){dob = scdb.getDob();}
        if(scdb.getFontColor()!=null){fontColor = scdb.getFontColor();}
    }
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <%@ include file="header.jsp" %>
    <script type="text/javascript" src="javascript/DOMhelp.js"></script>
    <script type="text/javascript" src="javascript/styleChange.js"></script>
    <body>
        <div id="container">
            <%@ include file="topNav.jsp" %>
            <%@ include file="leftside.jsp" %>
            <%@ include file="rightside.jsp" %>
            <div id="content">
                <h2>
                    WELCOME, <%=username%>! (<a href="AutismSiteMasterController?action=logoff">Logout</a>)
                </h2>
                
                <form id="profile" action="AutismSiteMasterController" method="post">
                    <input type="hidden" id="action" name="action" value="profile">
                    <input type="hidden" id="profileAction" name="profileAction" value="updateProfile">
                   
                    
                    <h4>Who are you?</h4>
                    <div id="name">
                            <input type="text" name="fname" id="fname" value=<%=fname%> > First Name
                            <br/>
                            <input type="text" name="lname" id="lname" value=<%=lname%>> Last Name
                            <br/>
                            <input type="text" name="dob" id="dob" value="<%=dob%>"> Date of Birth
                            <br/>
                            <br/>
                            <b>How does autism play a part in your life?</b>
                            
                                <% while(classRs.next()){ %>
                                <% classId = classRs.getInt("classificationID"); %>
                                <p>
                                    <input type="checkbox" name=<%=classId%> id=<%=classId%> value=<%=classId%> <%=classList.IsChecked(classId)%>>
                                        <%=classRs.getString("name")%>
                                    </input>
                                </p>
                                    
                                <% } %>
                            
                            <br/>
                    </div>
                    <hr/>
                    <h4>Where do you live?</h4>
                    <div id="address">
                            <input type="text" name="addr1" id="addr1" value="<%=addr1%>"> Address Line 1
                            <br/>
                            <input type="text" name="addr2" id="addr2" value="<%=addr2%>"> Address Line 2
                            <br/>
                            <input type="text" name="city" id="city" value="<%=city%>"> City
                            <br/>
                            
                            <select name="state">
                            <option selected value="<%=state%>"><%=state%></option>
                            <option value="AL">AL</option>
                            <option value="AK">AK</option>
                            <option value="AZ">AZ</option>
                            <option value="AR">AR</option>
                            <option value="CA">CA</option>
                            <option value="CO">CO</option>
                            <option value="CT">CT</option>
                            <option value="DE">DE</option>
                            <option value="DC">DC</option>
                            <option value="FL">FL</option>
                            <option value="GA">GA</option>
                            <option value="HI">HI</option>
                            <option value="ID">ID</option>
                            <option value="IL">IL</option>
                            <option value="IN">IN</option>
                            <option value="IA">IA</option>
                            <option value="KS">KS</option>
                            <option value="KY">KY</option>
                            <option value="LA">LA</option>
                            <option value="ME">ME</option>
                            <option value="MD">MD</option>
                            <option value="MA">MA</option>
                            <option value="MI">MI</option>
                            <option value="MN">MN</option>
                            <option value="MS">MS</option>
                            <option value="MO">MO</option>
                            <option value="MT">MT</option>
                            <option value="NE">NE</option>
                            <option value="NV">NV</option>
                            <option value="NH">NH</option>
                            <option value="NJ">NJ</option>
                            <option value="NM">NM</option>
                            <option value="NY">NY</option>
                            <option value="NC">NC</option>
                            <option value="ND">ND</option>
                            <option value="OH">OH</option>
                            <option value="OK">OK</option>
                            <option value="OR">OR</option>
                            <option value="PA">PA</option>
                            <option value="RI">RI</option>
                            <option value="SC">SC</option>
                            <option value="SD">SD</option>
                            <option value="TN">TN</option>
                            <option value="TX">TX</option>
                            <option value="UT">UT</option>
                            <option value="VT">VT</option>
                            <option value="VA">VA</option>
                            <option value="WA">WA</option>
                            <option value="WV">WV</option>
                            <option value="WY">WY</option>
                            </select>
                            <br/>
                            <input type="text" name="zip" id="zip" value=<%=zip%>> Zipcode
                            <br/>
                    </div>
                    <hr/>
                    <h4>How can you be contacted?</h4>
                    <div id="phone">
                            <input type="text" name="phone" id="phone" value=<%=phone%>> Phone Number 1
                            <br/>
                            <input type="text" name="cell" id="cell" value=<%=cell%>> Phone Number 2
                            <br/>
                    </div>
                    <hr/>
                    <h4>What colors do you want on your pages?</h4>
                    <div id="colors">
                        <script type="text/javascript">
                                window.onload=function(){
                                var formref=document.getElementById("switchform")
                                //indicateSelected(formref.choice)
                                //indicateSelected(formref.switchcontrol)
                                }
                        </script>
                            <a href="#" onclick="setActiveStyleSheet('rv1'); return false;">
                            <img class="imagemap" src="images/tricolorwheel_imap_big.png" width="263" height="263" border="0" usemap="#tricolorwheel_imap_big_Map" /></a>
                            <map name="tricolorwheel_imap_big_Map">
                            <area shape="poly" alt="Default Pattern, White" coords="127,119, 136,124, 136,133, 130,138, 121,133, 121,124" href="#" onclick="setActiveStyleSheet('white'); return false;">
                            <area shape="poly" alt="Light Red Purple" coords="97,89, 113,81, 124,120" href="#" onclick="setActiveStyleSheet('redpurp3'); return false;">
                            <area shape="poly" alt="Light Purple" coords="81,112, 91,95, 121,124" href="#" onclick="setActiveStyleSheet('purple3'); return false;">
                            <area shape="poly" alt="Light Blue Purple" coords="77,139, 77,119, 117,129" href="#" onclick="setActiveStyleSheet('bluepurp3'); return false;">
                            <area shape="poly" alt="Light Blue" coords="91,162, 81,147, 121,134" href="#" onclick="setActiveStyleSheet('blue3'); return false;">
                            <area shape="poly" alt="Light Blue Green" coords="124,141, 113,177, 95,168" href="#" onclick="setActiveStyleSheet('bluegreen3'); return false;">
                            <area shape="poly" alt="Light Green" coords="138,179, 118,181, 127,141" href="#" onclick="setActiveStyleSheet('green3'); return false;">
                            <area shape="poly" alt="Light Yellow Green" coords="157,168,139,177,133,141,162,168" href="#" onclick="setActiveStyleSheet('yellgreen3'); return false;">
                            <area shape="poly" alt="Light Yellow" coords="174,146, 163,163, 140,134" href="#" onclick="setActiveStyleSheet('yellow3'); return false;">
                            <area shape="poly" alt="Light Yellow Orange" coords="174,119, 174,139, 140,129" href="#" onclick="setActiveStyleSheet('yelloran3'); return false;">
                            <area shape="poly" alt="Light Orange" coords="165,95, 174,112, 138,121" href="#" onclick="setActiveStyleSheet('orange3'); return false;">
                            <area shape="poly" alt="Light Red Orange" coords="145,81, 165,90, 134,118" href="#" onclick="setActiveStyleSheet('redoran3'); return false;">
                            <area shape="poly" alt="Pink" coords="118,78, 139,78, 128,118" href="#" onclick="setActiveStyleSheet('red3'); return false;">
                            <area shape="poly" alt="Mid Red Purple" coords="69,65, 102,44, 113,78, 91,87" href="#" onclick="setActiveStyleSheet('redpurp2'); return false;">
                            <area shape="poly" alt="Mid Purple" coords="77,111, 44,102, 65,68, 89,90" href="#" onclick="setActiveStyleSheet('purple2'); return false;">
                            <area shape="poly" alt="Mid Blue Purple" coords="73,140, 44,148, 41,108, 73,118" href="#" onclick="setActiveStyleSheet('bluepurp2'); return false;">
                            <area shape="poly" alt="Mid Blue" coords="87,168, 62,190, 44,156, 75,147" href="#" onclick="setActiveStyleSheet('blue2'); return false;">
                            <area shape="poly" alt="Mid Blue Green" coords="113,185, 107,213, 69,198, 91,171" href="#" onclick="setActiveStyleSheet('bluegreen2'); return false;">
                            <area shape="poly" alt="Mid Green" coords="139,185, 148,215, 109,215, 117,185" href="#" onclick="setActiveStyleSheet('green2'); return false;">
                            <area shape="poly" alt="Mid Yellow Green" coords="185,193, 154,213, 145,181, 167,171" href="#" onclick="setActiveStyleSheet('yellgreen2'); return false;">
                            <area shape="poly" alt="Mid Yellow" coords="214,156, 192,190, 170,168, 184,147, 210,156" href="#" onclick="setActiveStyleSheet('yellow2'); return false;">
                            <area shape="poly" alt="Mid Yellow Orange" coords="214,109, 214,148, 185,140, 185,128, 185,118" href="#" onclick="setActiveStyleSheet('yelloran2'); return false;">
                            <area shape="poly" alt="Mid Orange" coords="192,68, 214,102, 184,109, 176,98, 170,89" href="#" onclick="setActiveStyleSheet('orange2'); return false;">
                            <area shape="poly" alt="Mid Red Orange" coords="155,44, 189,65, 167,87, 158,78, 145,73" href="#" onclick="setActiveStyleSheet('redoran2'); return false;">
                            <area shape="poly" alt="Mid Red" coords="109,43, 148,43, 140,72, 130,72, 118,72" href="#" onclick="setActiveStyleSheet('red2'); return false;">
                            <area shape="poly" alt="Dark Red Purple" coords="45,39, 67,22, 91,11, 102,39, 81,48, 65,61" href="#" onclick="setActiveStyleSheet('redpurp1'); return false;">
                            <area shape="poly" alt="Dark Purple" coords="39,100, 11,94, 23,67, 39,44, 61,65, 50,81" href="#" onclick="setActiveStyleSheet('purple1'); return false;">
                            <area shape="poly" alt="Dark Blue Purple" coords="36,148, 11,156, 7,124, 11,100, 36,108, 34,129" href="#" onclick="setActiveStyleSheet('bluepurp1'); return false;">
                            <area shape="poly" alt="Dark Blue" coords="58,193, 41,214, 23,190, 11,163, 36,156, 44,171" href="#" onclick="setActiveStyleSheet('blue1'); return false;">
                            <area shape="poly" alt="Dark Blue Green" coords="101,221, 95,248, 65,237, 44,219, 65,198, 81,213" href="#" onclick="setActiveStyleSheet('bluegreen1'); return false;">
                            <area shape="poly" alt="Dark Green" coords="149,223, 158,248, 130,253, 102,248, 107,223, 127,223" href="#" onclick="setActiveStyleSheet('green1'); return false;">
                            <area shape="poly" alt="Dark Yellow Green" coords="214,221, 190,237, 163,248, 156,219, 176,213, 192,198" href="#" onclick="setActiveStyleSheet('yellgreen1'); return false;">
                            <area shape="poly" alt="Dark Yellow" coords="247,164,237,191,218,215,198,194,210,178,221,157" href="#" onclick="setActiveStyleSheet('yellow1'); return false;">
                            <area shape="poly" alt="Dark Yellow Orange" coords="248,100, 253,129, 248,159, 222,149, 223,129, 223,108" href="#" onclick="setActiveStyleSheet('yelloran1'); return false;">
                            <area shape="poly" alt="Dark Orange" coords="218,44, 237,67, 247,94, 222,100, 214,87, 198,65" href="#" onclick="setActiveStyleSheet('orange1'); return false;">
                            <area shape="poly" alt="Dark Red Orange" coords="163,11, 190,22, 214,39, 192,61, 180,48, 156,38" href="#" onclick="setActiveStyleSheet('redoran1'); return false;">
                            <area shape="poly" alt="Red" coords="100,11, 129,6, 157,11, 149,36, 129,32, 109,36" href="#" onclick="setActiveStyleSheet('red1'); return false;">
                        </map>
                        <!-- End ImageReady Slices -->
                        <br /><br />
                            <legend>Use these buttons to choose the text color</legend>
                            <input type="radio" name="fontColor" value=<%=scdb.getFontColor()%> checked="checked" /><span style="color:<%=scdb.getFontColor()%>">Current Color</span>
                            <p class="fontColor">
                                
                                <input type="radio" name="fontColor" value="#000000" /><span style="color:#000000">Black</span>
                                <input type="radio" name="fontColor" value="#ffffff" /><span style="color:#ffffff">White</span>
                                <input type="radio" name="fontColor" value="#808080" /><span style="color:#808080">Gray</span>
                                <input type="radio" name="fontColor" value="#c0c0c0" /><span style="color:#c0c0c0">Silver </span>
                                <input type="radio" name="fontColor" value="#800000" /><span style="color:#800000">Maroon</span>
                                <input type="radio" name="fontColor" value="#ff0000" /><span style="color:#ff0000">Red</span>
                                <input type="radio" name="fontColor" value="#ffa500" /><span style="color:#ffa500">Orange</span>
                                <input type="radio" name="fontColor" value="#ffff00" /><span style="color:#ffff00">Yellow</span>
                                <input type="radio" name="fontColor" value="#00ff00" /><span style="color:#00ff00">Lime</span>
                                <input type="radio" name="fontColor" value="#008000" /><span style="color:#008000">Green</span>
                                <input type="radio" name="fontColor" value="#808000" /><span style="color:#808000">Olive</span>
                                <input type="radio" name="fontColor" value="#008080" /><span style="color:#008080">Teal</span>
                                <input type="radio" name="fontColor" value="#00ffff" /><span style="color:#00ffff">Aqua</span>
                                <input type="radio" name="fontColor" value="#0000ff" /><span style="color:#0000ff">Blue</span>                        
                                <input type="radio" name="fontColor" value="#000080" /><span style="color:#000080">Navy</span>
                                <input type="radio" name="fontColor" value="#800080" /><span style="color:#800080">Purple</span>
                            </p>
                    </div>
                    <input type="submit" name="submit" value="submit">
                </form>
            </div> <!-- div content -->
            
            <%@ include file="footer.jsp" %>
        </div> <!-- div container -->   
    </body>
</html>
<% 
    message="";
    session.setAttribute("message",message);

%>
